CREATE OR REPLACE FUNCTION ZOESECURITY.ZOEFUN_AUD_INS_AUD_DDL_RECORD
(ot_audit_log in zoetyp_aud_log)
RETURN INTEGER
AS
  PRAGMA AUTONOMOUS_TRANSACTION;
BEGIN

  INSERT INTO ZOESECURITY.AUD_DDL_RECORD
    (LOG_ID,USERNAME,OS_USERNAME,HOST,TERMINAL,IP_ADDRESS,CURRENT_USER,
      OBJECT_OWNER,OBJECT_NAME,OBJECT_TYPE,OPERATION_TYPE,OPERATION_TIME,RETURNCODE,SQL_TEXT)
    VALUES
    (ot_audit_log.LOG_ID,ot_audit_log.USERNAME,ot_audit_log.OS_USERNAME,
      ot_audit_log.HOST,ot_audit_log.TERMINAL,ot_audit_log.IP_ADDRESS,
      ot_audit_log.CURRENT_USER,ot_audit_log.OBJECT_OWNER,ot_audit_log.OBJECT_NAME,
      ot_audit_log.OBJECT_TYPE,ot_audit_log.OPERATION_TYPE,ot_audit_log.OPERATION_TIME,
      ot_audit_log.RETURNCODE,ot_audit_log.SQL_TEXT);
  COMMIT;
  RETURN 0;
  EXCEPTION
	WHEN OTHERS THEN
    ROLLBACK;
    DBMS_OUTPUT.PUT_LINE(SQLERRM);
		RETURN -1;

END ZOEFUN_AUD_INS_AUD_DDL_RECORD;
/